Passed
Push — master ( 50adea...d5902b )
by Amit
02:19
created

addHotMiddleware.js ➔ ???   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
nc 2
nop 1
dl 0
loc 10
rs 9.4285
c 1
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A addHotMiddleware.js ➔ ... ➔ ??? 0 4 2
1
/**
2
 * Loop through webpack entry
3
 * and add the hot middleware
4
 * @param  {Object} entry webpack entry
5
 * @return {Object} entry with hot middleware
6
 */
7
module.exports = (entry) => {
8
  const results = {};
9
  const hotMiddlewareScript = 'webpack-hot-middleware/client?timeout=20000&reload=true';
10
11
  Object.keys(entry).forEach((name) => {
12
    results[name] = Array.isArray(entry[name]) ? entry[name].slice(0) : [entry[name]];
13
    results[name].unshift(hotMiddlewareScript);
14
  });
15
  return results;
16
};
17